﻿#region

using System.Net;
using System.Web.Mvc;

#endregion

namespace HouseHoldBudget.Framework.Mvc
{
    public class WrappedJsonResult : JsonResult
    {
        #region Instance Methods

        public override void ExecuteResult(ControllerContext context)
        {
            context.HttpContext.Response.Write("<html><body><textarea id=\"jsonResult\" name=\"jsonResult\">");
            base.ExecuteResult(context);
            context.HttpContext.Response.Write("</textarea></body></html>");

            context.HttpContext.Response.ContentType = "text/html";
            context.HttpContext.Response.StatusCode = (int) HttpStatusCode.OK;
        }

        #endregion
    }
}